package com.lyh.hkcloud.module.common;

import android.app.Activity;
import android.app.ProgressDialog;
import com.lyh.hkcloud.activity.LoginActivity;

import java.io.Serializable;

/**
 * @author: zhongfan
 * @program: hkCloud
 * @description: 请稍后
 * @company—date: 利元数据 2022-02-16 14:03
 **/
public  class Loading {



    private  ProgressDialog progressDialog;
    /**
     * 提示加载
     */
    public  void showProgressDialog(String title, String message, Activity activity) {
        if (progressDialog == null) {

            progressDialog = ProgressDialog.show(activity, title, message, true, false);
        } else if (progressDialog.isShowing()) {
            progressDialog.setTitle(title);
            progressDialog.setMessage(message);
        }

        progressDialog.show();

    }

    /**
     * 隐藏提示加载
     */
    public void hideProgressDialog() {

        if (progressDialog != null && progressDialog.isShowing()) {
            progressDialog.dismiss();
        }

    }
}
